package com.ithei.多线程第二天.线程池;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo1 {
    public static void main(String[] args) throws InterruptedException {
        ExecutorService pool = Executors.newCachedThreadPool();
        pool.submit(()->{
            System.out.println(Thread.currentThread().getName()+"执行.........");
        });

        Thread.sleep(2000);
        pool.submit(()->{
            System.out.println(Thread.currentThread().getName()+" 执行.........");
        });

        pool.submit(()->{
            System.out.println(Thread.currentThread().getName()+"  执行.........");
        });
        pool.shutdown();;
    }
}
